package com.ruoyi.park.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.park.mapper.CarInfoMapper;
import com.ruoyi.park.domain.CarInfo;
import com.ruoyi.park.service.ICarInfoService;

/**
 * 业主车辆Service业务层处理
 * 
 * @author ru博雅oyi
 * @date 2023-12-11
 */
@Service
public class CarInfoServiceImpl implements ICarInfoService 
{
    @Autowired
    private CarInfoMapper carInfoMapper;

    /**
     * 查询业主车辆
     * 
     * @param carId 业主车辆主键
     * @return 业主车辆
     */
    @Override
    public CarInfo selectCarInfoByCarId(Long carId)
    {
        return carInfoMapper.selectCarInfoByCarId(carId);
    }

    /**
     * 查询业主车辆列表
     * 
     * @param carInfo 业主车辆
     * @return 业主车辆
     */
    @Override
    public List<CarInfo> selectCarInfoList(CarInfo carInfo)
    {
        return carInfoMapper.selectCarInfoList(carInfo);
    }

    /**
     * 新增业主车辆
     * 
     * @param carInfo 业主车辆
     * @return 结果
     */
    @Override
    public int insertCarInfo(CarInfo carInfo)
    {
        carInfo.setCreateTime(DateUtils.getNowDate());
        return carInfoMapper.insertCarInfo(carInfo);
    }

    /**
     * 修改业主车辆
     * 
     * @param carInfo 业主车辆
     * @return 结果
     */
    @Override
    public int updateCarInfo(CarInfo carInfo)
    {
        carInfo.setUpdateTime(DateUtils.getNowDate());
        return carInfoMapper.updateCarInfo(carInfo);
    }

    /**
     * 批量删除业主车辆
     * 
     * @param carIds 需要删除的业主车辆主键
     * @return 结果
     */
    @Override
    public int deleteCarInfoByCarIds(Long[] carIds)
    {
        return carInfoMapper.deleteCarInfoByCarIds(carIds);
    }

    /**
     * 删除业主车辆信息
     * 
     * @param carId 业主车辆主键
     * @return 结果
     */
    @Override
    public int deleteCarInfoByCarId(Long carId)
    {
        return carInfoMapper.deleteCarInfoByCarId(carId);
    }
}
